{/*LAYOUT模板*/}
	<layout name="layout"/>
{/*LAYOUT模板*/}

{/*import Js,Css*/}
	<js href="__PUBLIC__/Js/listTable.js"/>
	
	<css href="__PUBLIC__/Css/jquery-ui.css" />
	<js href="__PUBLIC__/Js/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/Js/core/plugins.js"/>
{/*import Js,Css*/}

<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<div id="content">
	<table id="mytab"  border="1" class="t1" width="100%">
		<tr class="a1">
			<th align="center" width="30px;">
				<span>{$Think.lang.selectall}</span>
				<input type="checkbox">
			</th>
			<th align="center" width="30px;">{$Think.lang.num}</th>
			<th align="center">{$Think.lang.ages}</th>
			<th align="center">{$Think.lang.sort_order}</th>
			<th align="center">{$Think.lang.invalid}</th>
			<th align="center">{$Think.lang.action}</th>
		</tr>
		<volist name="agesList" id="vo">
		<tr id="tr_{$vo.id}">
			<td align="center">		  	   
				<input type="checkbox" />		  
			</td>
			<td align="center">		  	   
				{$vo.id}	  
			</td>
			<td class="ctext">{$vo.name}</td>
			<td class="ctext">{$vo.sort}</td>
			<td class="ctext">
				<img class="pointer" onclick="listTable.changeStatus(this, 'invalid', {$vo.id});" 
					src="__PUBLIC__/Image/<if condition="$vo.invalid eq 0">bg_yes.gif<else/>bg_no.gif</if>"/>
			</td>
			<td>				
				<div class="action">			       		
					<span>	      		
						<a class="del" data="{$vo.id}" title="{$Think.lang.delete}"></a>
						<a class="mod" href="__URL__/updateage?id={$vo.id}" title="{$Think.lang.modify}"></a>
					</span>
				</div>
			</td>
		</tr>
		</volist>  	 
	</table>
	<include file="Library:paginator"/>
</div>

<!-- [气泡提示框插件HTML代码] -->
	<include file="Core:QTip"/>
<!-- [气泡提示框插件HTML代码] -->
<div id="loading"class="hide"><!--Qloading:不能删除--></div>

<script>
	//Initialize Url
	listTable.init('__URL__/ajaxAges');	
	jQuery(function($) {	
		/* 气泡提示框 */
		$('a[title]').qtip({ 
			style: { name: 'green'/* black,cream,green,dark,light,red,blue */, tip: true },
			position: { adjust: { screen: true } } /* 根据位置自动调整 */
		});
		// 移除年龄
		$("a.del").click(function(){
			// get Id
			var id = $(this).attr('data');		
			$.ajax({
				url:"__URL__/ajaxAges",
				data:{'id':id,'action':'del'},
				dataType:'json',
				type:'post',
				beforeSend:function(){
					$('#loading').QLoading({'text':'处理中','status':'open','model':false});
				},
				success:function(msg){				
					if(msg.data == '1'){
						var tr = $("#tr_" + id);
						tr.remove();
						$('#loading').QLoading({'text':msg.info,'status':'close','time':0.5,'img':'happy','model':false});
					}
					else{
						$('#loading').QLoading({'text':msg.info,'status':'close','time':2,'img':'sad','model':false});
					}
				}		
			});
		});
	});
</script>

